<template>
    <div slot="header" v-if="settings.isShow">
        <mt-header :title="settings.title" fixed>
            <mt-button icon="back" slot="left" v-if="settings.showBack" @click.native="onBackClick">返回</mt-button>
            <mt-button icon="more" slot="right" v-if="settings.showMore" @click.native="onMoreClick"></mt-button>
      </mt-header>
    </div>
</template>
<script>
    import { Header } from 'mint-ui'
    import * as constants from 'src/AppConstants'
    import * as types from 'store/mutation-types'
    import utils from 'commons/utils'

    export default {
        components: {},
        props: {
            settings: {
                type: Object,
                require: true
            }
        },
        data(){
        	return {}
        },
        methods: {
            onBackClick() {
                this.$store.commit(types.UPDATE_BACK_STATUS, true)
                utils.callFun(this.settings.backEvent)
                history.go(-1)
            },
            onMoreClick() {
            	utils.callFun(this.settings.moreEvent)
            }
        },
        created() {
        }
    }
</script>
<style lang="less">
</style>

